// DSAGraphView.h : interface of the CDSAGraphView class
//
/////////////////////////////////////////////////////////////////////////////

#pragma once

class CDSAGraphView : public CWindowImpl<CDSAGraphView>
{
public:
	DECLARE_WND_CLASS(NULL)

	BOOL PreTranslateMessage(MSG* pMsg)
	{
		pMsg;
		return FALSE;
	}

	BEGIN_MSG_MAP(CDSAGraphView)
		MESSAGE_HANDLER(WM_PAINT, OnPaint)
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
		MSG_WM_ERASEBKGND(OnEraseBkgnd)
	END_MSG_MAP()

// Handler prototypes (uncomment arguments if needed):
//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

	LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	{
		CPaintDC dc(m_hWnd);

		//TODO: Add your drawing code here
		//dc.Ellipse(0, 0, 30, 40);
		Draw(dc.m_hDC);
		return 0;
	}

	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	{
	//	selectedChannelEID = -1;
	//	currentPage = 0;
	//	viewType = false;
		calc = DSACalculator::GetInstance();
		return 0;
	}

	LRESULT OnEraseBkgnd(HDC hdc)
	{
		RECT rcBounds;
		GetClientRect(&rcBounds);
		FillRect(hdc, &rcBounds, CreateSolidBrush(RGB(0,0,160)));
		return 1;    // we painted the background
	}

private:
	std::vector< DSASingleGraph > subg;
	DSACalculator *calc;
	void Draw(HDC hdc);

public:
	void AddSubGraph( const DSA_SingleGraph des ){ 
		subg.push_back( DSASingleGraph(calc,des));
	}
};
